NCL ipython notebook contour polar


In [21]:
filename = "$HOME/NCL/NUG/Version_1.0/data/rectilinear_grid_2D.nc"

system("ncdump -h "+filename)


=
netcdf rectilinear_grid_2D {
dimensions:
        lon = 192 ;
        lat = 96 ;
        time = UNLIMITED ; // (40 currently)
variables:
        double lon(lon) ;
                lon:standard_name = "longitude" ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
        double lat(lat) ;
                lat:standard_name = "latitude" ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
        double time(time) ;
                time:standard_name = "time" ;
                time:units = "hours since 2001-01-01 00:00:00" ;
                time:calendar = "standard" ;
        float tsurf(time, lat, lon) ;
                tsurf:long_name = "surface temperature" ;
                tsurf:units = "K" ;
                tsurf:code = 169 ;
                tsurf:table = 128 ;
                tsurf:grid_type = "gaussian" ;
        float precip(time, lat, lon) ;
                precip:long_name = "total precipitation" ;
                precip:units = "kg/m^2s" ;
                precip:code = 4 ;
                precip:table = 128 ;
                precip:grid_type = "gaussian" ;
        float u10(time, lat, lon) ;
                u10:long_name = "10m u-velocity" ;
                u10:units = "m/s" ;
                u10:code = 165 ;
                u10:table = 128 ;
                u10:grid_type = "gaussian" ;
        float v10(time, lat, lon) ;
                v10:long_name = "10m v-velocity" ;
                v10:units = "m/s" ;
                v10:code = 166 ;
                v10:table = 128 ;
                v10:grid_type = "gaussian" ;
        float qvi(time, lat, lon) ;
                qvi:long_name = "vertically integrated water vapor" ;
                qvi:units = "kg/m^2" ;
                qvi:code = 230 ;
                qvi:table = 128 ;
                qvi:grid_type = "gaussian" ;
        float slp(time, lat, lon) ;
                slp:long_name = "mean sea level pressure" ;
                slp:units = "Pa" ;
                slp:code = 151 ;
                slp:table = 128 ;
                slp:grid_type = "gaussian" ;
}
>

In [22]:
f = addfile(filename,"r")




In [23]:
t = f->tsurf

printVarSummary(t)


Variable: t
Type: float
Total Size: 2949120 bytes
            737280 values
Number of Dimensions: 3
Dimensions and sizes:	[time | 40] x [lat | 96] x [lon | 192]
Coordinates: 
            time: [   0.. 234]
            lat: [88.57216851400727..-88.57216851400727]
            lon: [-180..178.125]
Number Of Attributes: 5
  grid_type :	gaussian
  table :	128
  code :	169
  units :	K
  long_name :	surface temperature

In [24]:
wks = gsn_open_wks("png","plot_polar")




In [25]:
res              =  True
res@cnFillOn     =  True
res@tiMainString = "Title string"

res@mpMinLatF    = 40
res@mpCenterLonF = 100

res@gsnPolar                 = "NH"
res@gsnPolarLabelDistance    =  1.1         ;-- default dist. is 1.04
res@gsnPolarLabelFontHeightF =  0.015

res@gsnPolarLabelSpacing     =  45          ;-- how frequently to label
res@gsnPolarLabelDistance    =  1.08        ;-- default is 1.04
res@gsnPolarLabelFontHeightF =  0.025       ;-- change font height of labels




In [26]:
plot = gsn_csm_contour_map_polar(wks,t(1,:,:),res)




In [ ]: